package hotciv.common;

import hotciv.framework.*;

import java.util.Collection;
import java.util.Map;

public interface ModifiableGame extends Game {

	/**
	 * return the city production stash for the city at position 'p' in the world. Precondition: There is a city at position p.
	 * @param p a position with a city
	 * @return the production stash for that city
	 */
	int getProductionStashInCityAt(Position p);

	/**
	 * Returns an iterable collection of cities in the world
	 * @return the collection of cities
	 */
	Collection<CityImpl> getCities();

	/**
	 * Adds a NEW city c to the layout at position p and sets it production stash to 0
	 * @param c the new city
	 * @param p the position of the new city
	 */
	void addCityAt(CityImpl c, Position p);

	/**
	 * Removes a unit at a given position p, from the game
	 * @param p the position to remove unit from
	 */
	void removeUnitAt(Position p);

	/**
	 * Get unit map with all units in the game
	 * @return the unit map with the units in the game
	 */
	Map<Position, UnitImpl> getUnits();

	/**
	 * Returns a Map associating won attacks by a player, with the age
	 * at which he won the attack
	 * @return Map<Integer,Player> - Map of Integers and players
	 */
	Map<Integer,Collection<Player>> getWonAttacks();

	/**
	 * Will span a unit of a given type at a given position with a given owner.
	 * Also given responsibillity of checking that the tile is free and usable
	 * @param pos - the position in where the unit should spawn.
	 * @param type - the type of the unit.
	 * @param owner - the owner of the unit.
	 */
	void spawnUnitAt(Position pos, String type, Player owner);
	
	/**
	 * Returns the number of rounds passed until now.
	 * @return the number of rounds passed.
	 * */
	int getRoundNumber();
}